<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="org.jfree.chart.ChartFactory,
org.jfree.chart.JFreeChart,
org.jfree.chart.plot.PlotOrientation,org.jfree.chart.ChartUtilities,
org.jfree.chart.servlet.*,
org.jfree.data.category.*,cn.ac.cintcm.sh.service.PrescriptionService"%> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'prHCCompareMost.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <%
    PrescriptionService prescriptionService = new PrescriptionService();
    List a = new ArrayList();
    String[] fiIds = request.getParameterValues("fjIds");
    int size = fiIds.length;
    for(int i=0 ; i<size ;i++){
     a.add(fiIds[i]);
    }
    CategoryDataset dataset = prescriptionService.getHCCompare(a);
    String title= "多方剂寒热比较";
	JFreeChart chart = ChartFactory.createBarChart3D(title,
	"寒热属性",
	"寒热值",
	dataset,
	PlotOrientation.VERTICAL,
	true,
	false,
	false);

String filename = ServletUtilities.saveChartAsPNG(chart, 500, 300, null, session);
  
String graphURL = request.getContextPath() + "/servlet/DisplayChart?filename=" + filename;
%>
<img src="<%= graphURL %>" width=600 height=400 border=0 usemap="#<%= filename %>">
  </body>
</html>
